(function($){
    $.fn.extend({
	infoContent: function(options) {

	    var defaults = {

		title:	'Okienko',
		info:	'informacyjne',
		w:	'50%',
		h:	175,
		bg: '#000',
		padding: 16,
		
		akcja: 'start'

	    };

	    var options = $.extend(defaults, options);

	    return this.each(function() {

	    var o = options;
	    var obj = $(this);

	    if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	    } else if (document.documentElement && document.documentElement.scrollTop) {
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	    } else if (document.body) {
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	    }
		var $body = $(this.ie6 ? document.body : document);
		var wh = jQuery(window).height();
		var ch = o.h;
		var ys = document.body.scrollTop;
		var nh = yScroll+(wh-ch)/2.5;
			jQuery("body").append('<div id="light" class="info_content"><div id="close"></div></div><div id="fade" class="black_overlay"></div>');
			$('#light').css({
			display: 'none',
			position: 'absolute',
			top: nh,
			left: '25%',
			width: o.w,
			height: ch,
			padding: o.padding+'px',
			zIndex:1002,
			opacity:0
			});
			$('#fade').css(
		{
		    display: 'none',
		    position: 'absolute',
		    top: '0%',
		    left: '0%',
		    width:$body.width(),
		    height:$body.height(),
		    backgroundColor: o.bg,
		    zIndex: 1001,
		    opacity:0
		});

		    var html = '<div id="close"></div><div class="title">'+o.title+'</div><div class="info">'+o.info+'</div>';
		    jQuery("#light").html(html);
		    jQuery('#fade').css({"display":"block"});
		    jQuery('#light').css({"display":"block"});
		    jQuery('#fade').animate({"opacity":"0.8"},"normal");
		    jQuery('#light').animate({"opacity":"1"},"normal");
		    jQuery('#close').css({"cursor":"pointer",zIndex:1003});

			jQuery(document).click(function(){
				jQuery('#light').fadeOut("fast", function(){
				jQuery('#light').remove();});
				jQuery('#fade').fadeOut("fast", function(){
				jQuery('#fade').remove();
				});
			});

	    });
	}
    });
})(jQuery)